package com.mingmen.canting.util;

import android.icu.util.Calendar;
import android.text.format.DateUtils;

import com.alibaba.fastjson.JSON;

import java.sql.Date;
import java.util.ArrayList;
import java.util.List;

public class MyStringUtils {

    public static String returnStringBuffer(List<String> mynewId) {
        StringBuilder sb = new StringBuilder();
        String resultString = "";
        boolean flag = false;
        for (String str : mynewId) {
            if (flag) {
                sb.append(",");
            } else {
                flag = true;
            }
            sb.append(str);
        }
        resultString = sb.toString();
        return resultString;
    }
    public static <T> String beanToString(T value) {
        Class<?> clazz = value.getClass();
        if(clazz == int.class || clazz == Integer.class) {
            return value + "";
        }else if(clazz == String.class) {
            return (String)value;
        }else if(clazz == long.class || clazz == Long.class) {
            return value + "";
        }else {
            return JSON.toJSONString(value);
        }
    }


}
